home *** CD-ROM | disk | FTP | other *** search
/ IRIS Performer 2.2 Friends Demo / SGI IRIS Performer 2.2 Friends Demo.iso / friends / devices / BGSystems / bg / lv3.h < prev    next >
C/C++ Source or Header  |  1997-10-31  |  4KB  |  138 lines

  1. /*
  2.  *
  3.  *----------------------------------------------------------------------
  4.  *
  5.  *  Filename:
  6.  *     lv3.h
  7.  *
  8.  *----------------------------------------------------------------------
  9.  *        Copyright (C) 1994-5   BG Systems, Inc.
  10.  *                  All rights reserved
  11.  *----------------------------------------------------------------------
  12.  *
  13.  *  File description:
  14.  *     Definitions for LV824 software
  15.  *
  16.  *  Modifications:
  17.  *     Name        Date        Comment
  18.  *     John Green  04-Jul-93   Created
  19.  *     John Green  15-Oct-94   Major modification for Rev 3.0
  20.  *     John Green  01-Feb-95   Cleanup for release
  21.  *     John Green  16-Apr-95   Added DriveBox
  22.  *
  23.  *----------------------------------------------------------------------
  24.  */
  25. #ifndef __LV_H
  26. #define __LV_H
  27.  
  28. static char lv_SccsId[] = "@(#)lv3.h    1.4  17 Apr 1995";
  29.  
  30. #include <time.h>
  31.  
  32. #define FLYBOX    1
  33. #define BEEBOX    2
  34. #define CEREALBOX 3
  35. #define CAB       4
  36. #define DRIVEBOX  5
  37.  
  38. #define FB_NOBLOCK 1
  39. #define FB_BLOCK 2
  40.  
  41. #define AIC1   0x01
  42. #define AIC2   0x02
  43. #define AIC3   0x04
  44. #define AIC4   0x08
  45. #define AIC5   0x10
  46. #define AIC6   0x20
  47. #define AIC7   0x40
  48. #define AIC8   0x80
  49.  
  50. #define AOC1   0x01
  51. #define AOC2   0x02
  52. #define AOC3   0x04
  53.  
  54. #define DIC1    0x10
  55. #define DIC2    0x20
  56. #define DIC3    0x40
  57.  
  58. #define DOC1    0x10
  59. #define DOC2    0x20
  60. #define DOC3    0x40
  61.  
  62. #define BAUD576 0x70
  63. #define BAUD384 0x60
  64. #define BAUD192 0x50
  65. #define BAUD96  0x40
  66. #define BAUD48  0x30
  67. #define BAUD24  0x20
  68. #define BAUD12  0x10
  69.  
  70. #define OFFSET  0x21
  71.  
  72. /*
  73.  *  Define some commands
  74.  */
  75.  
  76. #define BURST       'B'    /* Burst mode                  */
  77. #define BURST_SET   'b'    /* Burst mode rate set         */
  78. #define CONT        'c'    /* Continuous buffered         */
  79. #define DEFAULT     'd'    /* Reset to Default            */
  80. #define PACKET      'p'    /* One input and one output    */
  81. #define ONCE        'o'    /* One input                   */
  82. #define ONCE_CS     'O'    /* One input with check sum    */
  83. #define RESET_FB    'r'    /* Reset 3 chars with offset   */
  84. #define RESET_FB_O  'R'    /* Reset (rev 2.2 no offset)   */
  85. #define STOP        'S'    /* Stop burst mode             */
  86. #define SETUP       's'    /* Setup rev 3.0 eprom         */
  87. #define TEST1       'T'    /* Test (and copyright)        */
  88. #define TEST2       't'    /* Test (and copy, and rev #)  */
  89.  
  90. typedef struct rs_struct
  91. {
  92.   int  wrt;     /* write error */
  93.   int  rd;      /* read error  */
  94.   int  len;     /* string length error  */
  95.   int  nl;      /* last char error  */
  96.   int  cycles;  /* numer of cycles */
  97.   int  thou;    /* thousands of cycles */
  98. } RS_ERR;
  99.  
  100. typedef struct REVISION
  101. {
  102.    int    major;          /*  Software major revision             */
  103.    int    minor;          /*  Software minor revision             */
  104.    int    bug;            /*  Software bug revision               */
  105.    char   alpha;          /*  EPROM alpha revision                */
  106.    int    year;
  107. }revision;
  108.  
  109. /*
  110.  *  For v3.0 software, define a new structure
  111.  */
  112. typedef struct BGLV_STRUCT
  113. {
  114.    int    n_analog_in;    /*  Number of analog inputs (8 max)     */
  115.    int    analog_in;      /*  Analog input selector               */
  116.    int    n_dig_in;       /*  Number of digital inputs (24 max)   */
  117.    int    dig_in;         /*  Digital input selector              */
  118.    int    n_analog_out;   /*  Number of analog outputs (3 max)    */
  119.    int    analog_out;     /*  Analog out channel selector         */
  120.    int    n_dig_out;      /*  Number of digital outputs (24 max)  */
  121.    int    dig_out;        /*  Digital output selector             */
  122.    float  ain[8];         /*  Analog input data                   */
  123.    int    aout[3];        /*  Analog output data                  */
  124.    int    din[3];         /*  Digital input data                  */
  125.    int    dout[3];        /*  Digital output data                 */
  126.    long   count;
  127.    int    str_len;        /*  Length of string to expect          */
  128.    int    baud;           /*  Baud rate selected                  */
  129.    char   mode[2];        /*  Mode to send - rev 2.2              */
  130.    time_t tag;    
  131.    int    port;
  132.    int    box_type;       /*  Device type                         */
  133.    int    sp_fd;          /*  Serial port file descriptor         */
  134.    revision   Rev;        /*  Software major revision             */
  135. }bglv;
  136.  
  137. #endif /* __LV_H */
  138.